const DefaultEmptyXML = (key, name, type) => {
    const _now = new Date().getTime()
    key = key || `Process_${_now}`
    name = name || `业务流程_${_now}`
    type = type || 'activiti'

    const TYPE_TARGET = {
        activiti: 'http://activiti.org/bpmn',
        camunda: 'http://bpmn.io/schema/bpmn',
        flowable: 'http://flowable.org/bpmn',
    }
    // 初始化空白流程
    return `<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
                   xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
                   xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
                   xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
                   id="diagram_${key}"
                   targetNamespace="${TYPE_TARGET[type]}">
  <bpmn:process id="${key}" name="${name}" isExecutable="true"></bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${key}" />
  </bpmndi:BPMNDiagram>
</bpmn:definitions>`
};

export default DefaultEmptyXML;
